﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BTCairo
{
    public class StartModel : Model
    {
        int x;
        int y;
        int width;
        int height;
        
        public StartModel(CommonGraphics cg, AbstractFactory af, int _x, int _y, int w, int h)
        {
            myCommonGraphic = cg;
            AbstractFactory = af; 
            myCommonGraphic.MyInfoGraphic.x = _x;
            myCommonGraphic.MyInfoGraphic.y = _y;
            myCommonGraphic.MyInfoGraphic.widthShape = w;
            myCommonGraphic.MyInfoGraphic.heightShape = h;
            x = _x;
            y = _y;
            width = w;
            height = h;
        }
        public override InfoGraphic getInfoShape()
        {
            InfoGraphic info = myCommonGraphic.MyInfoGraphic;
            info.x = x;
            info.y = y;
            info.widthShape = width;
            info.heightShape = height;
            return info;
        }
        public override Shape CloneShape()
        {
            StartModel temp = new StartModel(myCommonGraphic.CloneCommonGraphic(), AbstractFactory.CloneFactory(), x, y, width, height);
            return temp;
        }
        public override Shape CloneShape(int plusX, int plusY)
        {
            StartModel temp = new StartModel(myCommonGraphic.CloneCommonGraphic(), AbstractFactory.CloneFactory(), x+plusX, y+plusY, width, height);
            return temp;
        }
        public override void Draw()
        {
            if (shadow != null)
                shadow.DoEffect(this);
            if (highlight != null)
                highlight.DoEffect(this);
            if (border != null)
                border.DoEffect(this);
            //AbstractFactory.DrawStart(myCommonGraphic, x, y, width, height);
            AbstractFactory.DrawStart(myCommonGraphic);
        }
        public override void DrawEffect()
        {
            AbstractFactory.DrawStart(myCommonGraphic);
        }

        public override void ParseXmlElement(System.Xml.XmlDocument doc, System.Xml.XmlElement root)
        {
            if (shadow != null)
                shadow.ParseXmlElement(doc, root);
            if (highlight != null)
                highlight.ParseXmlElement(doc, root);
            if (border != null)
                border.ParseXmlElement(doc, root);
            AbstractFactory.ParseXmlElementStart(doc, root);
        }
    }
}
